<template>
	<view>
		<view class="top" id="top">
			<commonNavBar title="动态评分" :showSearch="false" :showRobot="true"></commonNavBar>
			<view class="step">
				<view v-for="(tabs, index) in stepList" :key="index" @click="stepActive(index)">
					<view :class="{ 'active': tabIndex == index }">
						{{ tabs.step }}
					</view>
				</view>
			</view>
		</view>
		<view class="centre">
			<view class="content-container">
				<view class="addInspect" v-show="tabIndex == 0">
					<view class="map">
						<image src="@/static/img/mapActive.png" />
						<text @tap="companyDimension(riskData.lngLat)"
							v-text="isLocationPoint(riskData.lngLat) ? '主体已标注' : '主体未标注，请进行主体标注【点击开始主体标注】'"></text>
					</view>
					<view class="content">
						<view class="one">
							<view class="title">
								<view class="left">监管单位信息</view>
							</view>
							<view class="box">
								<view class="text">
									<view class="topicFlex">监管单位：</view>
									<text>{{ riskData.deptName }}</text>
								</view>
								<view class="text">
									<view class="topicFlex">检查时间：</view>
									<text>{{ riskData.checkTime }}</text>
								</view>
								<view class="text">
									<view class="topicFlex">执法人员1：</view>
									<uni-data-select v-model="riskData.scorePerson1Id" :localdata="userList"
										:clear="false" :placeholder="'请选择执法人员'"></uni-data-select>
								</view>
								<view class="text">
									<!-- <text style="color: red;">*</text> -->
									<!-- style="margin-left: -17px;" -->
									<view class="topicFlex topicFlexImportant">执法人员2：</view>
									<uni-data-select v-model="riskData.scorePerson2Id" :localdata="userList"
										:clear="false" :placeholder="'请选择执法人员'"></uni-data-select>
								</view>
							</view>
						</view>
						<view class="two">
							<view class="title">
								<view class="left">生产经营主体信息</view>
							</view>
							<view class="box">
								<view class="text">
									<view class="topicFlex">主体名称：</view>
									<text>{{ riskData.companyName }}</text>
								</view>
								<view class="text">
									<view class="topicFlex">经营地址：</view>
									<view
										style="width: 560rpx;text-overflow: ellipsis; white-space: nowrap;overflow: hidden;">
										<text>{{ riskData.companyAddress }}</text>
									</view>
								</view>
								<view class="text">
									<view class="topicFlex">主体类别：</view>
									<text>{{ riskData.companyType }}</text>
								</view>
								<view class="text">
									<view class="topicFlex">{{ riskData.supProcess == 'spxs' || riskData.supProcess ==
										'cyfw' ? '经营范围' : '品种明细' }}：</view>
									<text>{{ riskData.businessScope }}</text>
								</view>
								<view class="text">
									<view class="topicFlex">联系方式：</view>
									<input type="number" class="text" placeholder="请输入联系方式"
										v-model="riskData.concatPhone"
										style="padding-left:0px;margin-left: 0px;padding-top: 8px;" />
								</view>
								<view class="text">
									<view class="topicFlex">联系人：</view>
									<input type="text" class="text" placeholder="请输入联系人" v-model="riskData.concat"
										style="padding-left:0px;margin-left: 0px;padding-top: 8px;" />
								</view>
								<view class="text">
									<view class="topicFlex">法人：</view>
									<input type="text" class="text" placeholder="请输入法人" v-model="riskData.legalPerson"
										style="padding-left:0px;margin-left: 0px;padding-top: 8px;" />
								</view>
							</view>

						</view>

					</view>
				</view>
				<view class="addInspectContent" v-show="tabIndex == 1">
					<view class="positioning">
						<image src="@/static/img/mapActiveTwo.png" />
						<text @tap="companyDimension(riskData.lngLat)"
							v-text="isLocationPoint(riskData.lngLat) ? '主体已标注' : '主体未标注，请进行主体标注【点击开始主体标注】'"></text>
					</view>
					<view class="box">
						<view class="manage_status_box"
							v-if="riskData.supProcess == 'spsc' || riskData.supProcess == 'tssc'">
							<text class="manage_status_title">生产状态：</text>
							<radio-group v-model="riskData.manageStatus" @change="manageStatusChange"
								class="custom-radio-group">
								<label class="labelRadio" :class="{ 'yes': riskData.manageStatus === '0' }">
									<radio value="0" :checked="riskData.manageStatus === '0'" />
									在产
								</label>
								<label class="labelRadio" :class="{ 'no': (riskData.manageStatus === '1') }">
									<radio value="1" :checked="riskData.manageStatus === '1'" />
									长期停产
								</label>
							</radio-group>
						</view>
						<view class="manage_status_box" v-else>
							<text class="manage_status_title">经营状态：</text>
							<radio-group v-model="riskData.manageStatus" @change="manageStatusChange"
								class="custom-radio-group">
								<label class="labelRadio" :class="{ 'yes': riskData.manageStatus === '0' }">
									<radio value="0" :checked="riskData.manageStatus === '0'" />
									正常
								</label>
								<label class="labelRadio" :class="{ 'no': (riskData.manageStatus === '1') }">
									<radio value="1" :checked="riskData.manageStatus === '1'" />
									异常
								</label>
							</radio-group>
						</view>
						<view class="three" v-show="riskData.manageStatus === '0'">
							<view class="box">
								<view class="text facadePhoto">
									门脸照片：
									<image style="width:100px;height:100px;border:1px solid #e8e8e8;border-radius: 7px;"
										@tap="facadePhotoControl(riskData.companyPic)"
										:src="riskData.companyPic == undefined ? '/static/img/upload.png' : baseUrl + riskData.companyPic">
									</image>
								</view>
								<view class="text facadePhoto">
									告知页&nbsp;&nbsp;&nbsp;&nbsp;：
									<image style="width:100px;height:100px;border:1px solid #e8e8e8;border-radius: 7px;"
										@tap="showNoticeControl(riskData.informUrl)"
										:src="riskData.informUrl == undefined ? '/static/img/upload.png' : baseUrl + riskData.informUrl">
									</image>
								</view>
							</view>
						</view>
						<view class="abnormal"
							v-show="riskData.manageStatus === '1' && (riskData.supProcess == 'spxs' || riskData.supProcess == 'cyfw')">
							<view class="block">
								<view class="text">
									异常核查记录：
									<uni-data-select v-model="riskData.abnormalCheckRecord"
										:localdata="abnormalCauseList" :clear="false"></uni-data-select>
								</view>
								<!-- <view class="text">
									异常原因：
									<uni-data-select v-model="riskData.abnormalReason" :localdata="abnormalCauseList"  :clear="false"></uni-data-select>
								</view>
								<view class="text">
									异常情况核查记录：
									<input type="text" placeholder="必填项" v-model="riskData.abnormalCheckRecord"
										placeholder-class="placeholder-class" />
								</view> -->
								<view class="text">
									整改时间：
									<picker mode="date" @change="rectificationTimeClick">
										<view style="width: 600rpx;height:30rpx ">
											<text style="font-size: 19rpx;">
												{{ (riskData.resultTime == 'undefined' || riskData.resultTime ==
													undefined) ? '请选择时间' : riskData.resultTime }}
											</text>
										</view>
									</picker>
								</view>
								<view class="text">
									检查结果：
									<view class="div">
										<text>重点项发现问题（{{ totalEmphasisNum }}）项</text>
										<text>一般项发现问题（{{ totalGeneralNum }}）项</text>
									</view>
								</view>
								<view class="text">
									处理结果：
									<text>责令整改</text>
								</view>
							</view>
						</view>
						<!-- <view class="three" v-show="riskData.manageStatus != '1'"> -->
						<view class="dt">
							<!-- <view class="h1">动态评分总分值{{riskData.totalScore}}分</view> -->
							<view class="div">
								<view class="left">食品通用检查项目：</view>
								<view class="right">
									<view>重点发现问题<text>（{{ emphasisNum }}）</text>项</view>
									<view>一般发现问题<text>（{{ generalNum }}）</text>项</view>
								</view>
							</view>
							<view class="div">
								<view class="left">检查结果：</view>
								<radio-group v-model="riskData.checkResults" @change="accordRadioChange"
									class="custom-radio-group">
									<label class="labelRadio" :class="{ 'yes': riskData.checkResults == '符合' }">
										<radio value="符合" :disabled="hasContentSelect2Or3 || cljgStaus" />
										符合
									</label>

									<label class="labelRadio" :class="{ 'no': riskData.checkResults == '基本符合' }">
										<radio value="基本符合" :disabled="hasContentSelect2Or3" />
										基本符合
									</label>
									<label class="labelRadio" :class="{ 'no': riskData.checkResults == '不符合' }">
										<radio value="不符合" :disabled="hasContentSelect2Or3" />
										不符合
									</label>
									<label class="labelRadio" :class="{ 'no': riskData.checkResults == '其他' }">
										<radio value="其他" :disabled="hasContentSelect2Or3" />
										其他
									</label>
								</radio-group>
							</view>
							<view class="div">
								<view class="left">处理结果：</view>
								<radio-group v-model="riskData.copeResult" class="custom-radio-group"
									@change="selectCopeResult">
									<label class="labelRadio" :class="{ 'yes': (riskData.copeResult === '1') }">
										<radio value="1" :checked="riskData.copeResult === '1'"
											:disabled="checkResultStatus == '1' || checkResultStatus == '3'" />
										通过检查
									</label>
									<label class="labelRadio" :class="{ 'no': riskData.copeResult === '2' }">
										<radio value="2" :checked="riskData.copeResult === '2'"
											:disabled="checkResultStatus == '2' || checkResultStatus == '3'" />
										责令整改
									</label>
									<label class="labelRadio" :class="{ 'no': riskData.copeResult === '3' }">
										<radio value="3" :checked="riskData.copeResult === '3'"
											:disabled="checkResultStatus == '2' || checkResultStatus == '3'" />
										调查处理
									</label>
								</radio-group>
							</view>
							<view class="div" v-show="riskData.copeResult === '2' || riskData.copeResult === '3'">
								<view class="left">整改时间：</view>
								<view class="right" style="width:  70%;">
									<picker mode="date" @change="rectificationTimeClick">
										<view style="width: 600rpx;height:30rpx ">
											<text style="font-size: 19rpx;">
												{{ (riskData.resultTime == 'undefined' || riskData.resultTime ==
													undefined) ? '请选择时间' : riskData.resultTime }}
											</text>
										</view>
									</picker>
								</view>
							</view>
							<view class="div">
								<view class="left">其他需要记录的问题：</view>
								<view class="right">
									<view class="input-container">
										<input type="text" placeholder="请输入" v-model="riskData.otherProblem"
											placeholder-class="placeholder-class" />
									</view>
								</view>
							</view>
						</view>
						<view class="dd" style="padding-bottom: 50px;" v-for="(item, index) in riskData.projectList"
							:key="index" v-if="riskData.manageStatus === '0'">
							<view class="up">
								<view class="h1">
									{{ item.SERIAL_NUM }} {{ item.STANDARD_NAME }}
								</view>
								<view class="titles-right">
									<view class="list">
										<view class="option" @tap="inspectionContentActive(index, 1)"
											:class="{ 'active': item.rightButtonActive == 1 }">
											是
										</view>
										<view class="option" @tap="inspectionContentActive(index, 2)"
											:class="{ 'active': item.rightButtonActive == 2 }">
											否
										</view>
										<view class="option" @tap="inspectionContentActive(index, 3)"
											:class="{ 'active': item.rightButtonActive == 3 }">
											合理缺项
										</view>
									</view>
								</view>
							</view>
							<view class="block">
								<view class="li"
									:class="{ 'float-border': selectedContent == 'content' + index + ':' + dataIndex ? true : false }"
									@tap="contentSelectedStatus(index, dataIndex)"
									v-for="(data, dataIndex) in item.contentList" :key="dataIndex">
									<view class="titles">
										<view class="titles-left">
											<view class="text" :class="{ 'text-red': data.RISK_COUNT > 0 }">
												<text class='text-red' v-show="data.IMPORTENT_ITEM === '2'">*</text>
												{{ item.SERIAL_NUM }}.{{ data.SERIAL_NUM }}.&nbsp;&nbsp;{{
													data.CHECK_CONTENT }}
											</view>
										</view>
										<view class="titles-right">
											<view class="guide"
												v-if="checkExist(data.CHECK_BASIS, data.CHECK_GUIDE, data.CHECK_METHOD, data.CHECK_PROBLEM)"
												@tap="inspectionGuidelines(data.CHECK_BASIS, data.CHECK_GUIDE, data.CHECK_METHOD, data.CHECK_PROBLEM)">
												<image src="/static/img/questionMark.png" mode=""></image>
												检查指南
												<!-- <view class="triangle"></view> -->
											</view>
											<!-- <view class="guide" v-if="data.RISK_COUNT > 0"  @tap="showRiskContent(data.ID)">
												<image src="/static/img/questionMark.png" mode=""></image>
												风险提示 
											</view> -->
										</view>
									</view>
									<view class="optionList">
										<view class="list">
											<view class="option" :class="{ 'active': data.SELECTION == 1 }"
												@tap="selectContent(index, dataIndex, 1)">
												是
											</view>
											<view class="option" :class="{ 'active': data.SELECTION == 2 }"
												@tap="selectContent(index, dataIndex, 2)">
												否
											</view>
											<view class="option" :class="{ 'active': data.SELECTION == 3 }"
												v-show="data.MISSING_ITEM === '1'"
												@tap="selectContent(index, dataIndex, 3)">
												合理缺项
											</view>
										</view>
										<view class="case">
											<view v-if="data.SELECTION == 2">
												<view class="h2">问题描述 ：</view>
												<view class="no-realy-content">
													<uni-data-select v-if="data.PROBLEM_PRE_TYPE == 0"
														:value="data.PROBLEM_CONTENT" :localdata="data.checkProblemList"
														@change="problemDescriptionChange($event, index, dataIndex,
															item.TEMPLATE_ID,
															item.ID,
															data.ID, 2, data.PROBLEM_PRE_TYPE)" :clear="false"></uni-data-select>

													<rudon-multiSelector v-if="data.PROBLEM_PRE_TYPE == 1"
														:value="data.PROBLEM_CONTENT" welcome="请选择"
														:is_using_slot="false" :is_using_icon="false"
														:localdata="data.checkProblemList" @change="problemDescriptionChange(
															$event,
															index, dataIndex,
															item.TEMPLATE_ID,
															item.ID,
															data.ID, 2, data.PROBLEM_PRE_TYPE)" :clear="false">
													</rudon-multiSelector>

													<view class="content-upload-btn"
														v-if="data.PROBLEM_FILE == undefined && data.SELECTION == 2"
														@tap="uploadContentFile(index, dataIndex)">上传文件</view>
													<view class="content-upload-btn-realy"
														v-if="data.PROBLEM_FILE != undefined"
														@tap="showContentFileControls(index, dataIndex, data.PROBLEM_FILE)">
														点击查看</view>
												</view>
											</view>
											<view v-if="data.SELECTION == 3">
												<view class="h2">检查说明：</view>
												<!-- <uni-data-select v-model="data.MISSING_ITEM_CONTENT"
													:localdata="data.checkMissingList"
													:clear="false"></uni-data-select> -->

												<uni-data-select v-model="data.MISSING_ITEM_CONTENT"
													:localdata="data.checkMissingList" :clear="false"
													v-if="data.checkMissingList.length > 0"></uni-data-select>
												<textarea maxlength="2000" class="problem" placeholder="请输入备注信息" @input="saveMissingItemContent($event, index, dataIndex, item.TEMPLATE_ID,
													item.ID,
													data.ID, 3)" v-model="data.MISSING_ITEM_CONTENT_INPUT" placeholder-class="placeholder-class-inspect"
													v-else />
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>


					<!-- 2023-12-15 新增 -->
					<view class="socialResponsibility"
						v-show="riskData.IS_LIABILITY === '0' && riskData.manageStatus === '0'">
						<view class="title"
							v-if="socialResponsibilityData && socialResponsibilityData.itemList && socialResponsibilityData.itemList.length > 0">
							{{ this.socialResponsibilityData.templateName }}
						</view>
						<view class="list">
							<view class="li" v-for="(e, i) in this.socialResponsibilityData.itemList" :key="i">
								<view class="h1"
									style="display: flex; justify-content: space-between; align-items: center;">
									<view>{{ e.SERIAL_NUM }}.&nbsp;&nbsp;{{ e.STANDARD_NAME }}</view>
									<view class="global-options">
										<view class="option" :class="{ active: isAllSocialSelected(e, 1) }"
											@tap="setAllSocialSubItems(i, 1)">是</view>
										<view class="option" :class="{ active: isAllSocialSelected(e, 2) }"
											@tap="setAllSocialSubItems(i, 2)">否</view>
										<view class="option"
											v-if="e.contentList.some(es => es.MISSING_ITEM === '1') || riskData.SUP_PROCESS == 'spsc' || riskData.SUP_PROCESS == 'tssc'"
											:class="{ active: isAllSocialSelected(e, 3) }"
											@tap="setAllSocialSubItems(i, 3)">合理缺项</view>
									</view>
								</view>
								<view class="box">
									<view class="row" v-for="(es, is) in e.contentList" :key="is"
										:class="{ 'float-border': socialResponsibilitySelectedContent == 'content' + i + ':' + is ? true : false }"
										@tap="socialResponsibilityRow(i, is)">
										<view class="titles">
											<text :class="{ 'text-red': es.RISK_COUNT > 0 }"
												v-show="es.IMPORTENT_ITEM === '2'">*</text>
											<view class="text" :class="{ 'text-red': es.RISK_COUNT > 0 }">
												{{ e.SERIAL_NUM }}.{{ es.SERIAL_NUM }}.&nbsp;&nbsp;{{ es.CHECK_CONTENT
												}}
											</view>
										</view>

										<view class="optionList">
											<view class="list">
												<view class="option" :class="{ 'active': es.SELECTION == 1 }" @tap="socialResponsibilityRowOption(
													i,
													is,
													'是',
													e.TEMPLATE_ID,
													e.ID,
													es.ID,
													1
												)">
													是
												</view>
												<view class="option" :class="{ 'active': es.SELECTION == 2 }" @tap="socialResponsibilityRowOption(
													i,
													is,
													'否',
													e.TEMPLATE_ID,
													e.ID,
													es.ID,
													2
												)">
													否
												</view>
												<view class="option"
													v-if="es.MISSING_ITEM === '1' || riskData.SUP_PROCESS == 'spsc' || riskData.SUP_PROCESS == 'tssc'"
													:class="{ 'active': es.SELECTION == 3 }" @tap="socialResponsibilityRowOption(
														i,
														is,
														'合理缺项',
														e.TEMPLATE_ID,
														e.ID,
														es.ID,
														3
													)">
													合理缺项
												</view>
											</view>
											<view class="case">

											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>

			<view class="fixed">
				<button class="determine" @tap="savePopup('2')">提交</button>
				<button class="cancellation" @tap="savePopup('1')">临时保存</button>
			</view>
		</view>
		<!-- 检查指南 -->
		<uni-popup ref="inspectionGuidelines" type="bottom">
			<view class="inspectionGuidelinesContent">
				<view class="title">检查指南</view>
				<view class="box">
					<view class="div">
						<view class="titles">
							检查依据
						</view>
						<view class="contents">
							{{ checkBasis }}
						</view>
					</view>
					<view class="div">
						<view class="titles">
							检查方式
						</view>
						<view class="contents">
							{{ checkGuide }}
						</view>
					</view>
					<view class="div">
						<view class="titles">
							检查指南
						</view>
						<view class="contents">
							{{ checkMethod }}
						</view>
					</view>
					<view class="div">
						<view class="titles">
							常见问题
						</view>
						<view class="contents">
							{{ checkProblem }}
						</view>
					</view>
					<view class="closeReturn" @tap="inspectionGuidelinesClose">关闭</view>
				</view>
			</view>
		</uni-popup>
		<!-- 结果记录 -->
		<uni-popup ref="resultLog" type="bottom" :mask-click="false">
			<view class="popupContent" style="padding-bottom: 20px;">
				<view class="title">结果记录</view>
				<view class="box">
					<view class="box-item" style="margin-top: 10px;">
						<view class="box-item-left">
							<view style="width: 150px;text-align: left;"><text>结果记录表:</text></view>
							<image :src="jieguojilu == '' ? '/static/img/no-pic.png' : jieguojilu"
								style="width: 100px;height: 100px;" @tap="showImage(jieguojilu)"></image>
						</view>
						<text class="btna" @tap="resultTable(riskData.supProcess)">生成结果记录表</text>
					</view>
				</view>
				<view class="button">
					<button class="determine" @click="finalResultLog">确认</button>
					<button class="cancellation" @click="closeResultLog">取消</button>
				</view>
			</view>
		</uni-popup>
		<!-- 基础信息-告知单 -->
		<uni-popup ref="noticeForm" type="bottom">
			<view class="noticeFormPopupContent">
				<view class="title">电子告知单</view>
				<view class="h1Title">食品销售经营日常监督检查</view>
				<view class="h2Ttitle">告知页</view>
				<view class="box">
					<view class="div">
						<view class="titles">被检查单位：</view>
						<text class="value">{{ riskData.companyName }}</text>
					</view>
					<view class="div">
						<view class="titles">地址：</view>
						<text class="value">{{ riskData.companyAddress }}</text>
					</view>
					<view class="div">
						<view class="titles">
							检查人员1
							<!-- <text>执法证件编号：</text> -->
						</view>
						<uni-data-select :value="riskData.scorePerson1Id" :localdata="userList" :clear="false"
							:placeholder="'请选择检查人员'" :disabled="true"></uni-data-select>
					</view>
					<view class="div">
						<view class="titles">
							检查人员2
							<!-- <text>执法证件编号：</text> -->
						</view>
						<uni-data-select :value="riskData.scorePerson2Id" :localdata="userList" :disabled="true"
							:clear="false" :placeholder="'请选择检查人员'"></uni-data-select>
					</view>
					<view class="div">
						<view class="titles">检查时间：</view>
						<text class="value">{{ riskData.checkTime }}</text>
					</view>
					<view class="div">
						<view class="titles">检查地点：</view>
						<text class="value">{{ riskData.companyAddress }}</text>
					</view>
					<view class="div">
						<view class="titles">告知事项：</view>
						<view class="textarea">{{ notificationText | notificationFilter(this) }} </view>
					</view>
					<view class="div">
						<view class="titles">
							问：你（单位）
							<text>是否申请回避？</text>
						</view>
						<uni-data-select :localdata="applyForAvoidanceList" :value="applyForAvoidanceValue"
							:clear="false" :placeholder="'请选择是否回避'"></uni-data-select>
					</view>
					<view class="div">
						<view class="titles">被检查单位签字：</view>
						<view class="signature" @tap="signature(1)">点击签字</view>
						<image class="sig-image" v-if="riskData.sigOnePic != ''" :src="riskData.sigOnePic"></image>
					</view>
					<view class="div">
						<view class="titles">检查人员1签字：</view>
						<view class="signature" @tap="signature(2)">点击签字</view>
						<image class="sig-image" v-if="riskData.sigTwoPic != ''" :src="riskData.sigTwoPic"></image>
					</view>
					<view class="div">
						<view class="titles">检查人员2签字：</view>
						<view class="signature" @tap="signature(3)">点击签字</view>
						<image class="sig-image" v-if="riskData.sigThreePic != ''" :src="riskData.sigThreePic"></image>
					</view>
				</view>
				<view class="button">
					<button class="determine" @tap="noticeFormDetermine">保存</button>
					<button class="cancellation" @tap="noticeFormCancellation">预览</button>
				</view>
			</view>
		</uni-popup>
		<!-- 显示告知单预览 -->
		<uni-popup ref="popupNotificationTwo" type="bottom">
			<view ref="popupNotificationContent" class="popupContent"
				style="padding: 14px;padding-bottom: 50px;overflow-y: auto;">
				<view id="scrrent-page">
					<view style="text-align: center;font-size: 23px;font-weight: 700;">食品经营销售日常监督检查要点表</view>
					<view style="text-align: center;font-size: 18px;font-weight: 700;">告知页</view>
					<view style="border: 1px solid #dadada;padding: 10px;margin-top: 20px;">
						<view class="item-text">被检查单位：{{ riskData.companyName }}</view>
						<view class="item-text">地址：{{ riskData.companyAddress }}</view>
						<view class="item-text">检查人员1：{{ riskData.scorePerson1Id | userNameFilter(this) }}</view>
						<view class="item-text">检查人员2：{{ riskData.scorePerson2Id | userNameFilter(this) }}</view>
						<view class="item-text">检查时间：{{ riskData.checkTime }}</view>
						<view class="item-text">告知事项：{{ notificationText | notificationFilter(this) }} </view>
						<view class="item-text"> 问：你（单位）是否申请回避？</view>
						<view class="item-text"> {{ applyForAvoidanceList[applyForAvoidanceValue.value] }} </view>
						<view class="item-text">
							检查单位签字: <image class="sig-image" :src="riskData.sigOnePic"></image>
						</view>
						<view class="item-text">
							检查人员1签字: <image class="sig-image" :src="riskData.sigTwoPic"></image>
						</view>
						<view class="item-text">
							检查人员2签字: <image class="sig-image" :src="riskData.sigThreePic"></image>
						</view>
					</view>
				</view>
				<view class="button">
					<button class="determine" @click="printNotification">确认</button>
					<button class="cancellation" @click="closeNotification">关闭</button>
				</view>
			</view>
		</uni-popup>
		<!-- 检查项可能存在的风险 -->
		<uni-popup ref="riskTypePopup" type="bottom">
			<view class="inspectionGuidelinesContent">
				<view class="title">可能存在风险</view>
				<view class="box">
					<view class="div" v-for="(item, index) in checkContentRiskList">
						<view class="titles">
							{{ index + 1 }}.
						</view>
						<view class="contents">
							{{ item.TYPE_NAME }}
						</view>
					</view>
					<view class="closeReturn" @tap="riskTypePopupClose">关闭</view>
				</view>
			</view>
		</uni-popup>
		<!-- 提交弹窗 -->
		<uni-popup ref="popupTwo" type="bottom">
			<view class="popupContent">
				<view class="title">确定</view>
				<view class="box">
					提交当前评分？
				</view>
				<view class="button" style="padding-bottom:20px;">
					<button class="determine" @click="finalSave('temporarily')">确认</button>
					<button class="cancellation" @click="closeConfirm">返回</button>
				</view>
			</view>
		</uni-popup>
		<screenshot ref="screenshot" :screenId="'scrrent-page'" @renderFinish="getScreenImg"></screenshot>
	</view>
</template>

<script>
import longscreen from '@/components/screenShot.vue'
import commonNavBar from '@/components/CommonNavBar.vue';
import {
	base64ToPath
} from '@/static/js/image-tools.js'

export default {
	components: {
		commonNavBar,
		'screenshot': longscreen
	},
	data() {
		return {
			tabIndex: 0,
			totalEmphasisNum: 0,
			totalGeneralNum: 0,
			selectedContent: null, //被选中的检查内容
			checkResultStatus: '2', //检查结果可选
			emphasisNum: 0,
			generalNum: 0,
			checkBasis: '’', //检查指南中的检查依据
			checkGuide: '', //检查指南中的检查方式
			checkMethod: '', //检查指南中的检查指南
			checkProblem: '', //检查指南中的常见问题 
			baseUrl: uni.$baseUrl,
			jieguojilu: '',
			stepList: [{
				step: '基础信息',
				active: true
			}, {
				step: '评分内容',
				active: false
			}],
			abnormalCauseList: [{
				value: "不在注册地经营",
				text: "不在注册地经营"
			}],
			applyForAvoidanceValue: 0,
			applyForAvoidanceList: [{
				value: 0,
				text: "否"
			},
			{
				value: 1,
				text: "是"
			},
			],
			problemDescriptionList: [{
				value: '未按要求标注相关信息',
				text: "未按要求标注相关信息"
			},
			{
				value: '标注内容不合法',
				text: "标注内容不合法"
			},
			],
			inspectionInstructionsList: [{
				value: "仅销售预包装食品，无需取得食品经营许可",
				text: "仅销售预包装食品，无需取得食品经营许可"
			},],
			errNum: 0,
			navHeight: 0,
			checkContentRiskList: [],
			userList: [],
			notificationText: uni.$notificationText,
			riskData: {},
			hasContentSelect2Or3: false,
			cljgStaus: false,
			// 2024.12.15
			socialResponsibilityData: {},
			socialResponsibilitySelectedContent: null
		}
	},
	filters: {
		notificationFilter(value, that) {
			return value.replace(/\${([^}]+)}/g, that.riskData.deptName);
		},
		userNameFilter(value, that) {
			for (var i = 0; i < that.userList.length; i++) {
				if (that.userList[i].id == value) {
					return that.userList[i].text;
				}
			}
			return '';
		}
	},
	onLoad(options) {
		this.riskData.companyId = options.companyId
	},
	onReady() {
		this.initData();
		this.getUserList();
	},
	methods: {
		// 检查内容检查结果
		accordRadioChange(option) {
			this.$set(this.riskData, 'checkResults', option.target.value);
		},
		async initData() {
			//初始化页面数据  
			const that = this;
			uni.showLoading({
				title: '加载页面数据',
				mask: true
			})
			const res = await uni.$api.getDynamicContentInfo({
				companyId: this.riskData.companyId
			});

			if (res.data.code != '0') {
				uni.showModal({
					title: '警告',
					content: res.data.message,
					showCancel: false,
				})
				return;
			}
			that.riskData = res.data.data
			that.checkId = res.data.data.checkId;
			uni.hideLoading();
			this.loadErrorNum();
			// 2024.12.15
			this.socialResponsibility()
			console.log('that.riskData', that.riskData)
		},
		// 检查内容记录表选项选中状态
		async selectContent(index, dataIndex, option) {
			//数据存储在本地
			var d = this.riskData.projectList[index].contentList[dataIndex];
			this.$set(d, "SELECTION", option);
			//修改问题项数量
			this.loadErrorNum();
			if (option === 3) {
				if (this.riskData.projectList[index].contentList[dataIndex].checkMissingList.length === 1) {
					this.$set(d, "MISSING_ITEM_CONTENT", this.riskData.projectList[index].contentList[dataIndex]
						.checkMissingList[0].value)
				}
			} else {
				this.$set(d, "MISSING_ITEM_CONTENT", '');
			}

			this.loadResultBtn()

		},
		loadResultBtn() {
			let allYes = true;
			let hasNoOrReasonable = false;
			let hasBasicCompliance = false;
			let falseList = [];
			let inspectionResults = false;

			for (var i = 0; i < this.riskData.projectList.length; i++) {
				for (var y = 0; y < this.riskData.projectList[i].contentList.length; y++) {
					let content = this.riskData.projectList[i].contentList[y];
					let contentSelect = this.riskData.projectList[i].contentList[y].SELECTION;

					if (contentSelect !== undefined && typeof contentSelect === 'string') {
						contentSelect = Number(contentSelect);
					}


					if (contentSelect !== 1 && contentSelect !== undefined) {
						allYes = false;
						falseList.push(this.riskData.projectList[i].contentList[y]);

						if (content.IMPORTENT_ITEM === "2" && contentSelect != 3) {
							hasNoOrReasonable = true;
							break;
						} else if (content.IMPORTENT_ITEM === "1" && (contentSelect === 2 || contentSelect === 3)) {
							console.log('111')
							if (contentSelect === 2) {
								inspectionResults = true
							}
							hasBasicCompliance = true;
						}
					}
				}
				if (hasNoOrReasonable) break;
			}

			// console.log('inspectionResults----', inspectionResults)
			// console.log('hasNoOrReasonable', hasNoOrReasonable)
			// console.log('hasBasicCompliance', hasBasicCompliance)
			// console.log('falseCount', this.falseCount)
			this.falseCount = falseList.length;
			if (this.falseCount > 0) {
				if (hasNoOrReasonable) {
					this.$set(this.riskData, "checkResults", '不符合');
					this.$set(this.riskData, "copeResult", '3');
					this.hasContentSelect2Or3 = true;
					this.checkResultStatus = '1';
				} else if (hasBasicCompliance) {

					console.log('inspectionResults', inspectionResults)
					if (inspectionResults) {
						this.$set(this.riskData, "checkResults", '基本符合');
						this.$set(this.riskData, "copeResult", '2');
						this.hasContentSelect2Or3 = false;
						this.checkResultStatus = '1';
						this.cljgStaus = true;
					} else {
						this.$set(this.riskData, "checkResults", '符合');
						this.$set(this.riskData, "copeResult", '1');
						this.hasContentSelect2Or3 = false;
						this.cljgStaus = false;
						this.checkResultStatus = '';
					}
				}
				// this.hasContentSelect2Or3 = true;
			} else {
				if (hasBasicCompliance) {
					this.$set(this.riskData, "checkResults", '符合');
					this.$set(this.riskData, "copeResult", '1');
					this.hasContentSelect2Or3 = false;
					this.cljgStaus = false;
					this.checkResultStatus = '';
				} else {
					this.$set(this.riskData, "checkResults", '符合');
					this.$set(this.riskData, "copeResult", '1');
					this.hasContentSelect2Or3 = false;
					this.cljgStaus = false;
					this.checkResultStatus = '';
				}
			}
		},
		// 选择合理缺项-问题描述自定义之后手动输入
		async saveMissingItemContent(e, index, dataIndex, templateId, standardId, contentId, result) {
			const that = this;
			var d = this.riskData.projectList[index].contentList[dataIndex];
		},
		contentSelectedStatus(index, dataIndex) {
			//实现选中样式 
			this.selectedContent = 'content' + index + ':' + dataIndex;
		},
		loadErrorNum() {
			//计算选择的重点项发现问题数，一般项发现问题数量
			this.totalEmphasisNum = 0; //重点项问题数
			this.totalGeneralNum = 0; //重点项问题数
			this.emphasisNum = 0; //重点项问题数
			this.errNum = 0; //总错误数
			this.generalNum = 0; //一般项问题数
			this.riskData.totalScore = 0;
			var itemList = this.riskData.projectList;
			for (var i = 0; i < itemList.length; i++) {
				for (var y = 0; y < itemList[i].contentList.length; y++) {
					this.riskData.totalScore = this.riskData.totalScore + 1;
					if (itemList[i].contentList[y].IMPORTENT_ITEM == '2') {
						this.totalEmphasisNum = this.totalEmphasisNum + 1;
						if (itemList[i].contentList[y].SELECTION === 2) {
							this.emphasisNum = this.emphasisNum + 1;
							this.errNum = this.errNum + 1
						}
					} else {
						this.totalGeneralNum = this.totalGeneralNum + 1;
						if (itemList[i].contentList[y].SELECTION == 2) {
							this.generalNum = this.generalNum + 1;
							this.errNum = this.errNum + 1
						}
					}
				}
			}
			console.log('this.errNum', this.errNum)
			// if (this.errNum > 0) {
			// 	this.checkResultStatus = '1'
			// 	this.$set(this.riskData, "copeResult", "");
			// } else {
			// 	this.checkResultStatus = '2'
			// 	this.$set(this.riskData, "copeResult", "1");
			// }
		},
		// 检查内容记录表选项-否-问题描述
		async problemDescriptionChange(e, index, dataIndex, templateId, standardId, contentId, result,
			problemPreType) {
			if (problemPreType == '1') {
				//多选
				var d = this.riskData.projectList[index].contentList[dataIndex];
				const selectedOptions = this.riskData.projectList[index].contentList[dataIndex].checkProblemList
					.filter(option => option.is_selected);
				const selectedTexts = selectedOptions.map(option => option.text).join("##");
				this.$set(d, "PROBLEM_CONTENT", selectedTexts);
			} else {
				//单选
				var d = this.riskData.projectList[index].contentList[dataIndex];
				this.$set(d, "PROBLEM_CONTENT", e);
			}
		},
		// 选择否-自定义的时候上传文件信息
		async uploadContentFile(index, dataIndex) {
			const that = this;
			uni.chooseImage({
				count: 1,
				success: (e) => {
					plus.io.resolveLocalFileSystemURL(e.tempFilePaths[0], function (entry) {
						entry.file(function (file) {
							var fileReader = new plus.io.FileReader()
							fileReader.onload = function (evt) {
								that.$set(that.riskData.projectList[index]
									.contentList[dataIndex], "PROBLEM_FILE",
									evt.target.result);
							}
							fileReader.readAsDataURL(file)
						}, function (error) {
							uni.showToast({
								title: '图片生成失败',
								icon: 'error'
							})
						})
					}, function (error) {
						uni.showToast({
							title: '获取文件失败',
							icon: 'error'
						})
					})
				},
				fail: () => {
					uni.showToast({
						icon: 'error',
						title: '图片选择错误'
					})
				}
			})
		},
		showContentFileControls(index, dataIndex, filePath) {
			//检查内容选否之后上传文件后点击弹出选择查看文件还是上传文件
			const that = this;
			uni.showActionSheet({
				itemList: ['查看文件', '重新上传'],
				title: '选择操作',
				success: function (res) {
					if (res.tapIndex == 0) {
						let url = filePath;
						if (filePath.indexOf(";base64") < 0) {
							url = uni.$baseUrl + url;
						} else if (filePath.indexOf(";base64") > 0) {
							base64ToPath(url)
								.then(path => {
									Vue.prototype.$previewImage(path);
								})
								.catch(error => {
									console.error(error);
								})
							return;
						}
						Vue.prototype.$previewImage(url);
					} else if (res.tapIndex == 1) {
						that.uploadContentFile(index, dataIndex);
					}
				}
			})


		},
		facadePhotoControl(filePath) {
			const that = this;
			if (filePath == undefined || filePath == 'undefined') {
				that.facadePhotoOpen();
				return;
			}
			uni.showActionSheet({
				itemList: ['查看文件', '重新上传'],
				title: '选择操作',
				success: function (res) {
					if (res.tapIndex == 0) {
						Vue.prototype.$previewImage(filePath);
					} else if (res.tapIndex == 1) {
						that.facadePhotoOpen();
					}
				}
			})

		},
		facadePhotoOpen() {
			//门头照上传
			const that = this;
			uni.chooseImage({
				count: 1,
				// sourceType:['camera'],
				success: (e) => {
					uni.uploadFile({
						url: '/riskManager/uploadDynamicCheckFile',
						filePath: e.tempFilePaths[0],
						header: {
							'content-Type': 'multipart/form-data',
						},
						name: 'file',
						formData: {
							checkId: that.riskData.checkId
						},
						success: (res) => {
							const result = JSON.parse(res.data);
							if (result.code === 0) {
								uni.showToast({
									title: '上传成功',
									icon: 'error'
								})
								that.$set(that.riskData, "companyPic", result.data.comanyPic);
							} else {
								uni.showToast({
									title: '上传失败',
									icon: 'error'
								})
							}
						},
						fail: () => {
							uni.showToast({
								title: '上传失败',
								icon: 'error'
							})
						}
					})
				},
				fail: () => {
					uni.showToast({
						icon: 'error',
						title: '图片选择错误'
					})
				}
			})

		},
		showNoticeControl(filePath) {
			const that = this;
			if (filePath == undefined || filePath == 'undefined') {
				that.noticeFormOpen();
				return;
			}
			uni.showActionSheet({
				itemList: ['查看文件', '重新生成'],
				title: '选择操作',
				success: function (res) {
					if (res.tapIndex == 0) {
						Vue.prototype.$previewImage(filePath);
					} else if (res.tapIndex == 1) {
						that.noticeFormOpen();
					}
				}
			})
		},
		noticeFormOpen() {
			const that = this;
			uni.showActionSheet({
				itemList: ['生成告知单', '选择文件'],
				title: '选择操作',
				success: function (res) {
					if (res.tapIndex == 0) {
						that.$refs.noticeForm.open('bottom');
					} else if (res.tapIndex == 1) {
						uni.chooseImage({
							count: 1,
							sourceType: ['album', 'camera'],
							success: (e) => {
								plus.io.resolveLocalFileSystemURL(e.tempFilePaths[0], function (
									entry) {
									//参数path:图片相对路径
									entry.file(function (file) {
										var fileReader = new plus.io
											.FileReader()
										fileReader.readAsDataURL(file)
										fileReader.onloadend = function (evt) {
											// let base64 = evt.target.result.split(",")[1]
											// console.log('获取到base64',evt.target.result);
											that.saveNotice(evt.target
												.result);
										}
									})
								})
							},
							fail: () => {
								uni.showToast({
									icon: 'error',
									title: '图片选择错误'
								})
							}
						})
					}
				}
			})
		},
		async signature(index) {
			//告知单签名
			const that = this;
			//签名
			uni.navigateTo({
				url: '/pages/signature/signature',
				events: {
					updateSign(data) {
						if (index == 1) {
							that.$set(that.riskData, "sigOnePic", data);
						} else if (index == 2) {
							that.$set(that.riskData, "sigTwoPic", data);
						} else if (index == 3) {
							that.$set(that.riskData, "sigThreePic", data);
						}
					}
				}
			})
		},
		// 基础信息告知页保存
		noticeFormDetermine() {
			if (this.riskData.sigOnePic == '' || this.riskData.sigOnePic == undefined) {
				uni.showToast({
					title: '请完成签名',
					icon: 'none'
				})
				return;
			}

			if (this.riskData.sigTwoPic == '' || this.riskData.sigTwoPic == undefined) {
				uni.showToast({
					title: '请完成签名',
					icon: 'none'
				})
				return;
			}

			if (this.riskData.sigThreePic == '' || this.riskData.sigThreePic == undefined) {
				uni.showToast({
					title: '请完成签名',
					icon: 'none'
				})
				return;
			}

			this.$refs.popupNotificationTwo.open();
		},
		// 基础信息告知页预览打印
		noticeFormCancellation() {
			if (this.riskData.sigOnePic == '' || this.riskData.sigOnePic == undefined) {
				uni.showToast({
					title: '请完成签名',
					icon: 'none'
				})
				return;
			}

			if (this.riskData.sigTwoPic == '' || this.riskData.sigTwoPic == undefined) {
				uni.showToast({
					title: '请完成签名',
					icon: 'none'
				})
				return;
			}

			if (this.riskData.sigThreePic == '' || this.riskData.sigThreePic == undefined) {
				uni.showToast({
					title: '请完成签名',
					icon: 'none'
				})
				return;
			}
			this.$refs.popupNotificationTwo.open();
		},
		printNotification() {
			const that = this;
			uni.showLoading({
				title: '正在生成',
				mask: true
			})

			//将告知单存储页面生成图片保存到相册并上传到服务器
			this.$refs.screenshot.startScreen();
		},
		// 关闭告知页预览打印
		closeNotification() {
			this.$refs.popupNotificationTwo.close()
		},
		getScreenImg(res) {
			//生成告知单图片的
			const that = this;
			//根据传输过来的id 和选中的图片传到后台直接保存 
			uni.saveImageToPhotosAlbum({
				filePath: res.posterPath,
				success: function () {
					uni.hideLoading();
					uni.showLoading({
						title: '正在保存告知单信息',
						mask: true
					})
					plus.io.resolveLocalFileSystemURL(res.posterPath, function (entry) {
						//参数path:图片相对路径
						entry.file(function (file) {
							var fileReader = new plus.io.FileReader()
							fileReader.readAsDataURL(file)
							fileReader.onloadend = function (evt) {
								// let base64 = evt.target.result.split(",")[1]
								// console.log('获取到base64',evt.target.result);
								that.saveNotice(evt.target.result);
							}
						})
					})
				},
				fail: () => {
					uni.hideLoading();
					uni.showToast({
						icon: 'error',
						title: '请给与相册权限，否则告知单将无法存贮在手机中'
					})
				}
			})

		},
		async saveNotice(noticePic) {
			//保存告知单到服务器
			const that = this;
			const res = await uni.$api.saveRiskDynamicCheckInform({
				checkId: that.riskData.checkId,
				informFile: noticePic
			});

			uni.hideLoading();
			if (res.data.code == '0') {
				this.$set(that.riskData, 'informUrl', res.data.data.informUrl);
				uni.showModal({
					content: '保存成功,告知单图片已自动存储到相册',
					title: '提示',
					showCancel: false,
					success: function () {
						that.$refs.popupNotificationTwo.close();
						that.$refs.noticeForm.close();
					}
				})
			} else {
				uni.showToast({
					icon: 'success',
					title: '告知单存储失败'
				})
			}
		},
		//保存数据
		savePopup(type) {
			this.saveType = type
			if (type == '1') {
				//临时保存 
				this.finalSave('temporarily');
				return;
			}
			if (type != '1') {
				//表单填写验证
				if (this.riskData.scorePerson1Id == '' || this.riskData.scorePerson1Id == undefined) {
					uni.showToast({
						title: '请选择执法人员',
						icon: 'none'
					})
					return;
				}
				if (this.riskData.scorePerson2Id == '' || this.riskData.scorePerson2Id == undefined) {
					uni.showToast({
						title: '请选择执法人员',
						icon: 'none'
					})
					return;
				}
				if (this.riskData.manageStatus == '' || this.riskData.manageStatus == undefined) {
					uni.showToast({
						title: '请选择经营状态',
						icon: 'none'
					})
					return;
				}
				if (this.riskData.manageStatus != '1') {
					/*		if(this.riskData.companyPic == null || this.riskData.companyPic == ''){
								uni.showModal({
									title:'提示',
									content:'请上传门脸照',
									showCancel:false
								})
								return;
							}*/
					if (this.riskData.informUrl == null || this.riskData.informUrl == '') {
						uni.showModal({
							title: '提示',
							content: '请上传告知单',
							showCancel: false
						})
						return;
					}
					//检查内容是否全部选择 
					const itemList = this.riskData.projectList;
					for (var y = 0; y < itemList.length; y++) {
						const contentList = itemList[y].contentList;
						for (var i = 0; i < contentList.length; i++) {
							if (contentList[i].SELECTION == '' || contentList[i].SELECTION == undefined) {
								uni.showToast({
									title: `${itemList[y].SERIAL_NUM}.${contentList[i].SERIAL_NUM}存在检查内容还未处理`,
									icon: 'none'
								})
								return;
							} else {
								//如果已经选择否了
								if (contentList[i].SELECTION == '2' && contentList[i].PROBLEM_FILE == undefined) {
									uni.showToast({
										title: `${itemList[y].SERIAL_NUM}.${contentList[i].SERIAL_NUM}选择否的检查内容需要上传文件信息`,
										icon: 'none'
									})
									return;
								} else if (contentList[i].SELECTION == '2' && contentList[i].PROBLEM_CONTENT ==
									undefined) {
									uni.showToast({
										title: `${itemList[y].SERIAL_NUM}.${contentList[i].SERIAL_NUM}有检查内容的问题描述信息未选择原因`,
										icon: 'none'
									})
									return;
								} else if (contentList[i].SELECTION == '2' && contentList[i].PROBLEM_CONTENT ==
									'自定义备注' && contentList[i].PROBLEM_CONTENT_INPUT == undefined) {
									uni.showToast({
										title: `${itemList[y].SERIAL_NUM}.${contentList[i].SERIAL_NUM}有检查内容的问题描述中自定义备注信息未填写`,
										icon: 'none'
									})
									return;
								} else if (contentList[i].SELECTION == '3' && contentList[i].MISSING_ITEM_CONTENT ==
									'自定义备注' && contentList[i].MISSING_ITEM_CONTENT_INPUT == undefined) {
									uni.showToast({
										title: `${itemList[y].SERIAL_NUM}.${contentList[i].SERIAL_NUM}有检查内容的合理缺项中自定义备注信息未填写`,
										icon: 'none'
									})
									return;
								} else if (contentList[i].SELECTION == '3' &&
									(contentList[i].MISSING_ITEM_CONTENT === undefined || contentList[i]
										.MISSING_ITEM_CONTENT === '') &&
									(contentList[i].MISSING_ITEM_CONTENT_INPUT === undefined || contentList[i]
										.MISSING_ITEM_CONTENT_INPUT.trim() === '')) {
									uni.showToast({
										title: `${itemList[y].SERIAL_NUM}.${contentList[i].SERIAL_NUM}有检查内容中的合理缺项未填写原因`,
										icon: 'none'
									});
									return;
								}


							}
						}
					}
					//非异常情况
					if (this.riskData.copeResult == '' || this.riskData.copeResult == undefined) {
						uni.showToast({
							title: '请选择检查内容中的处理结果',
							icon: 'none'
						})
						return;
					}
					//选择责令整改或者调查处理的时候验证整改时间是否选择
					if (this.riskData.copeResult != '1' && this.riskData.resultTime == undefined) {
						uni.showToast({
							title: '请选择整改时间',
							icon: 'none'
						})
						return;
					}
				}
				if (this.riskData.manageStatus == '1') {
					//异常情况
					/* if(this.riskData.abnormalReason == ''  || this.riskData.abnormalReason  == undefined ){
						uni.showToast({
							title:'请选择异常原因',
							icon : 'none'
						})
						return;
					} */
					if (this.riskData.abnormalCheckRecord == '' || this.riskData.abnormalCheckRecord == undefined) {
						uni.showToast({
							title: '请填写异常情况核查记录',
							icon: 'none'
						})
						return;
					}
					if (this.riskData.resultTime == '' || this.riskData.resultTime == undefined) {
						uni.showToast({
							title: '请填写选择整改时间',
							icon: 'none'
						})
						return;
					}
				}
			}
			this.$refs.popupTwo.open('bottom');
		},
		async finalSave(type) {
			console.log('type', type)

			uni.showLoading({
				title: '正在提交',
				mask: true
			});

			//如果选择的经营异常,则直接是完整保存
			if (this.riskData.manageStatus == '1') {
				//经营异常直接完整保存
				this.overSave();
			} else {
				//临时保存一下
				const res = await uni.$api.saveRiskDynamicCheck({
					"riskData": JSON.stringify(this.riskData),
					"liabilitySituationData": JSON.stringify(this.socialResponsibilityData)
				})
				uni.hideLoading();
				if (res.data.code != '0') {
					uni.showModal({
						icon: 'error',
						content: res.data.message,
						showCancel: false
					})
					return;
				}
				uni.showToast({
					icon: 'success',
					title: '保存成功'
				})

				//保存结果记录表
				this.$refs.popupTwo.close();
				this.$refs.resultLog.open();
			}
		},
		async overSave() {
			uni.showLoading({
				title: '正在提交',
				mask: true
			});
			const res = await uni.$api.saveRiskDynamicCheckStatus({
				"riskData": JSON.stringify(this.riskData),
				"liabilitySituationData": JSON.stringify(this.socialResponsibilityData)
			})
			uni.hideLoading();
			if (res.data.code != '0') {
				uni.showModal({
					icon: 'error',
					content: res.data.message,
					showCancel: false
				})
				return;
			}
			const eventChannel = this.getOpenerEventChannel();
			eventChannel.emit('reloadList');
			uni.navigateBack();
		},
		resultTable(supProcess) {
			const that = this;
			uni.showActionSheet({
				itemList: ['结果记录表', '选择文件'],
				title: '选择操作',
				success: function (res) {
					if (res.tapIndex == 0) {
						//生成结果记录表 
						if (supProcess == 'spxs' || supProcess == 'cyfw') {
							let url = '/pages/risk/resultTable?id=' + that.riskData.checkId;
							if (that.riskData.resultTime !== undefined && that.riskData.resultTime !==
								'' && that.riskData.resultTime !== null) {
								url += '&time=' + that.riskData.resultTime;
							}
							uni.navigateTo({
								url: url,
								events: {
									yaodianbiao: function (data) {
										that.jieguojilu = that.baseUrl + data
									}
								}
							})
						} else {
							uni.navigateTo({

								url: '/pages/risk/productionResultTable?id=' + that.riskData
									.checkId,
								events: {
									// 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
									yaodianbiao: function (data) {
										that.jieguojilu = that.baseUrl + data
									}
								}
							})
						}
					} else {
						// console.log('11111', e.tempFilePaths[0])
						uni.chooseImage({
							count: 1,
							// sourceType:['camera'],
							success: (e) => {
								const uploadTask = uni.uploadFile({
									url: '/riskManager/uploadResultRecord', //仅为示例，非真实的接口地址
									filePath: e.tempFilePaths[0],
									name: "imgFile",
									timeout: '10000', //超时时间10秒
									formData: {
										"checkId": that.checkId,
										"type": '2'
									},
									dataType: 'json',
									success: (upRes) => {
										const result = JSON.parse(upRes.data);
										if (result.code == '1') {
											uni.showModal({
												content: '保存失败,请重新尝试',
												showCancel: false
											})
										}
										that.jieguojilu = uni.$baseUrl + result
											.data;
									},
									fail(err) {
										uni.showModal({
											content: '保存失败,请重新尝试',
											showCancel: false
										})
									},
									complete() {
										uni.hideLoading()
									}
								});
							},
							fail: () => {
								uni.showToast({
									icon: 'error',
									title: '图片选择错误'
								})
							}
						})
					}
				}
			})
		},
		closeConfirm() {
			this.$refs.popupTwo.close();
		},
		async finalResultLog() {
			if (this.jieguojilu == '') {
				uni.showToast({
					title: '结果记录表还未填写'
				})
				return;
			}
			this.overSave();
		},
		closeResultLog() {
			this.$refs.resultLog.close();
		},
		// 切换选项卡
		stepActive(index) {
			// if(this.riskData.manageStatus == '1' && index == 1){
			// 	uni.showToast({
			// 		title:'经营异常无需维护检查内容',
			// 		icon:'none'
			// 	})
			// 	return ;
			// }
			this.tabIndex = index
		},
		// 跳转客服 
		robot() {
			let message = "";
			if (this.selectedContent != null && this.selectedContent != '') {
				let selectedContent = this.selectedContent;
				selectedContent = selectedContent.replace('content', "");
				let selectedContentArray = selectedContent.split(':');
				var d = this.riskData.projectList[selectedContentArray[0]].contentList[selectedContentArray[1]];
				message = d.CHECK_CONTENT;
			}
			uni.navigateTo({
				url: '/pages/robot/robot',
				success: (res) => {
					res.eventChannel.emit('sendDefaultMessage', {
						message: message
					})
				}

			})
		},
		checkExist(v1, v2, v3, v4) {
			//判断是否存在检查指南
			if ((v1 == undefined || v1 == '') && (v2 == undefined || v2 == '') && (v3 == undefined || v3 == '') && (
				v4 == undefined || v4 == '')) {
				return false;
			} else {
				return true;
			}


		},
		//认证主体是否已经标注
		isLocationPoint(lng_lat) {
			if (lng_lat != undefined && lng_lat != '' && lng_lat != 'undefined') {
				return true;
			} else {
				return false;
			}
		},
		companyDimension(lng_lat) {
			//进入到企业标注
			const that = this;
			uni.showToast({
				title: lng_lat
			})
			// if (lng_lat != undefined && lng_lat != '' && lng_lat != 'undefined') {
			// 	//已经标注过了
			// 	uni.navigateTo({
			// 		url: '/pages/dimension/showPoint?companyId=' + this.riskData.companyId + '&lng_lat=' + lng_lat
			// 	})
			// 	return;
			// }
			uni.navigateTo({
				url: '/pages/dimension/dimension?companyId=' + this.riskData.companyId + '&lng_lat=' + lng_lat,
				events: {
					// 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
					updateLngLat: function (data) {
						that.$set(that.riskData, "lngLat", data.lng_lat);
					}
				},
			})
		},
		manageStatusChange(e) {
			// 选择经营状态 
			this.$set(this.riskData, "manageStatus", e.target.value);
			// 2025-2-24增加
			if (e.target.value == '1') {
				this.$set(this.riskData, "checkResults", '不符合');
				this.$set(this.riskData, "copeResult", '2');
				this.$set(this.riskData, "checkResultStatus", "2");
				this.checkResultStatus = '3'
				this.hasContentSelect2Or3 = true;
			} else {
				this.$set(this.riskData, 'checkResults', '符合');
				this.$set(this.riskData, "copeResult", '1');
				this.$set(this.riskData, "checkResultStatus", "1");
				this.checkResultStatus = ''
				this.hasContentSelect2Or3 = false;
			}
		},
		// 检查内容-操作指南
		inspectionGuidelines(checkBasis, //检查指南中的检查依据
			checkGuide, //检查指南中的检查方式
			checkMethod, //检查指南中的检查指南
			checkProblem) {
			this.checkBasis = checkBasis
			this.checkGuide = checkGuide
			this.checkMethod = checkMethod
			this.checkProblem = checkProblem
			if (this.$refs.inspectionGuidelines) {
				this.$refs.inspectionGuidelines.open('bottom')
			}
		},
		// 检查内容-操作指南关闭
		inspectionGuidelinesClose() {
			this.$refs.inspectionGuidelines.close()
		},
		async getUserList() {
			//获取执法人员列表
			//获取监管人员信息
			const useRes = await uni.$api.getSupervisePersonList();
			this.userList = useRes.data.data;
		},
		showImage(url) {
			Vue.prototype.$previewImage(url);
		},
		selectCopeResult(e) {
			//选择结果 
			this.riskData.copeResult = e.target.value;
		},
		async showRiskContent(checkContentId) {
			//查看风险提示
			uni.showLoading({
				title: '获取信息',
				mask: true
			})
			this.checkContentRiskList = [];
			const res = await uni.$api.getRiskTypeByCheckContent({
				checkContentId: checkContentId
			})
			uni.hideLoading();
			if (res.data.code == '0') {
				this.checkContentRiskList = res.data.data;
			}
			this.$refs.riskTypePopup.open("bottom");
		},
		riskTypePopupClose() {
			this.$refs.riskTypePopup.close();
		},
		// 基础信息整改时间选择日期
		rectificationTimeClick(e) {
			this.$set(this.riskData, 'resultTime', e.target.value);
		},
		// 社会责任评分模板
		async socialResponsibility() {
			const that = this;
			let data = {
				companyId: that.riskData.companyId,
				dynamicScoringId: that.riskData.checkId
			}
			const res = await uni.$api.socialResponsibilityList(data);
			that.socialResponsibilityData = res.data.data
			console.log('that.socialResponsibilityData', that.socialResponsibilityData)
		},
		socialResponsibilityRow(i, is) {
			this.socialResponsibilitySelectedContent = 'content' + i + ':' + is;
		},
		socialResponsibilityRowOption(i, is, option, templateId, standardId, contentId, result) {
			var d = this.socialResponsibilityData.itemList[i].contentList[is];
			this.$set(d, "SELECTION", result);
			// this.$set(d,"MISSING_ITEM_CONTENT",this.inspectionInstructionsList[0].value);
			this.loadErrorNum();
			if (result === 3) {
				if (this.socialResponsibilityData.itemList[i].contentList[is].checkMissingList.length === 1) {
					this.$set(d, "MISSING_ITEM_CONTENT", this.socialResponsibilityData.itemList[i].contentList[is]
						.checkMissingList[0].value);
				}
			} else {
				this.$set(d, "MISSING_ITEM_CONTENT", '');
			}
		},
		inspectionContentActive(index, value) {

			var d = this.riskData.projectList[index];
			this.$set(d, "rightButtonActive", value)
			var contentList = d.contentList;

			for (var i = 0; i < contentList.length; i++) {
				if (value === 3) {
					if (d.contentList[i].MISSING_ITEM === '1') {
						//存在3的按钮
						this.$set(d.contentList[i], "SELECTION", value);
					}
					if (this.riskData.projectList[index].contentList[i].checkMissingList.length === 1) {
						this.$set(d.contentList[i], "MISSING_ITEM_CONTENT", this.riskData.projectList[index]
							.contentList[i].checkMissingList[0].value);
					}
				} else {
					this.$set(d.contentList[i], "SELECTION", value);
					this.$set(d.contentList[i], "MISSING_ITEM_CONTENT", '');
				}
			}

			this.loadErrorNum();
			this.loadResultBtn()
		},
		// 判断大类下所有小项是否都选中某个选项
		isAllSocialSelected(e, option) {
			return e.contentList.every(es => es.SELECTION == option);
		},
		// 批量设置大类下所有小项的选项
		setAllSocialSubItems(index, option) {
			this.socialResponsibilityData.itemList[index].contentList.forEach((content, idx) => {
				this.$set(this.socialResponsibilityData.itemList[index].contentList, idx, {
					...content,
					SELECTION: option
				});
				// 合理缺项时自动填充原因
				if (option === 3) {
					if (content.checkMissingList && content.checkMissingList.length === 1) {
						this.$set(this.socialResponsibilityData.itemList[index].contentList[idx], "MISSING_ITEM_CONTENT", content.checkMissingList[0].value);
					}
				} else {
					this.$set(this.socialResponsibilityData.itemList[index].contentList[idx], "MISSING_ITEM_CONTENT", '');
				}
			});
			this.loadErrorNum();
			this.loadResultBtn && this.loadResultBtn();
		}
	}
}
</script>

<style lang="scss">
page {
	background: #F9F9F9;
	height: calc(100vh - 195rpx);
}

.top {
	position: fixed;
	top: 0px;
	z-index: 9999;
}

.intelligence {
	position: absolute;
	right: 30rpx;
	top: 50%;
	transform: translate(0%, -50%);
	font-size: 28rpx;
	font-family: PingFangSC-Medium, PingFang SC;
	font-weight: 500;
	color: #FFFFFF;
	display: flex;

	image {
		width: 75rpx;
		height: 64rpx;
	}
}


.step {
	display: flex;
	justify-content: space-around;
	height: 80rpx;
	line-height: 80rpx;
	background: #F9F9F9;
	width: 750rpx;

	view {
		position: relative;
		font-size: 25rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #999999;

		&.active {
			color: #0552A9;

			&::before {
				display: block;
				content: "";
				position: absolute;
				left: 50%;
				bottom: 0%;
				transform: translate(-50%, 0%);
				width: 100rpx;
				height: 5rpx;
				background: #0552A9;
			}
		}
	}
}


.centre {
	margin: 195rpx 0 0 0;
	// padding: 0 17.5rpx;
	height: calc(100vh - 280rpx);
	overflow-x: hidden;

	.content-container {

		.title {
			height: 73rpx;
			line-height: 73rpx;
			background: #E1EAF4;
			display: flex;
			text-indent: 50rpx;
			font-size: 24rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #002B5B;
		}

		.addInspect {
			padding: 0 0 50rpx 0;

			.map {
				height: 80rpx;
				line-height: 80rpx;
				background: url('../../static/img/map.png') no-repeat center center;
				background-size: cover;
				font-size: 23rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #002E63;
				margin: 0 auto;
				display: flex;
				align-items: center;

				image {
					width: 22rpx;
					height: 26rpx;
					margin: 0 11rpx 0 53rpx;
				}
			}

			.content {

				.text {
					font-size: 19rpx !important;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #333333;
					margin: 0 auto 13rpx;
					height: 68rpx;
					line-height: 68rpx;
					display: flex;
					align-items: center;
					padding: 0 50rpx;
					background: #fff;

					text {
						color: #666666;
					}

					.uni-stat__select {
						width: 460rpx;

						/deep/.uni-select {
							border: none;
						}

						/deep/.uni-select__input-placeholder {
							font-size: 19rpx;
						}

						/deep/.uni-select__selector-item {
							font-size: 19rpx;
							font-family: PingFangSC-Regular, PingFang SC;
							font-weight: 400;
							color: #333333;
							padding: 5px 10px !important;
							text-align: left !important;
							line-height: 1.6 !important;
						}

						/deep/.uni-select__selector-empty {
							font-size: 19rpx;
							font-family: PingFangSC-Regular, PingFang SC;
							font-weight: 400;
							color: #333333;
						}
					}

					.uni-date {
						width: 460rpx;

						/deep/.uni-date-editor--x {
							border: none;
						}
					}

					.custom-radio-group {
						display: flex;

						.labelRadio {
							display: flex;
							margin: 0 10rpx;
							align-items: center;
						}

						/deep/.uni-radio-input {
							width: 20rpx;
							height: 20rpx;
							border: 1rpx solid #979797;
						}

						.yes {

							/deep/.uni-radio-input {
								background: #07D276 !important;
								border-color: #07D276 !important;

								&::before {
									background: #07D276;
									border-radius: 50%;
									font-size: 16rpx;
								}
							}
						}

						.no {

							/deep/.uni-radio-input {
								background: #FF1F1F !important;
								border-color: #FF1F1F !important;
								position: relative;
								transform: rotate(45deg);

								&::before {
									content: "";
									position: absolute;
									top: 50%;
									left: 50%;
									background-color: #fff;
									width: 2rpx;
									height: 60%;
									transform: translate(-50%, -50%);
								}

								&::after {
									content: "";
									position: absolute;
									top: 50%;
									left: 50%;
									background-color: #fff;
									width: 60%;
									height: 2rpx;
									transform: translate(-50%, -50%);
								}
							}
						}
					}

					uni-navigator {
						display: flex;
						align-items: center;
						color: #0552A9;
					}

					&:nth-child(even) {
						background: #F9F9F9;
					}

					.topicFlex {
						display: flex;
						justify-content: flex-end;
						width: 16%;
						position: relative;
					}

					.topicFlexImportant::before {
						display: block;
						content: "*";
						color: red;
						position: absolute;
						top: 2px;
						left: -5px;
					}

					text {
						width: 80%;
						line-height: 1.6;
					}
				}

				.two {

					.box {

						.text {

							.input-container {

								input {
									font-size: 19rpx;
								}
							}
						}
					}

					.abnormal {

						.block {

							.text {

								.div {
									display: flex;
									flex-direction: column;
									line-height: initial;
								}
							}
						}
					}
				}

				.three {

					.box {

						.text {

							view {
								color: #1e4de6
							}
						}

						.facadePhoto {
							height: 150px;

							image {
								width: 100rpx;
								height: 100rpx;
							}
						}
					}
				}
			}
		}

		.addInspectContent {
			padding: 0 17.5rpx 300rpx 17.5rpx;

			.positioning {
				display: flex;
				align-items: center;
				height: 56rpx;
				line-height: 56rpx;
				background: #33B97C;
				box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
				border-radius: 28rpx;
				font-size: 23rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
				margin: 14rpx auto;

				image {
					width: 22rpx;
					height: 26rpx;
					margin: 0 11rpx 0 53rpx;
				}
			}

			.box {

				.dt {
					background: #FFFFFF;
					box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
					border-radius: 15rpx;
					padding: 23rpx 28rpx;
					position: fixed;
					width: 694rpx;
					left: 0rpx;
					bottom: 110rpx;
					;
					z-index: 2;

					.h1 {
						font-size: 24rpx;
						font-family: PingFangSC-Medium, PingFang SC;
						font-weight: 500;
						color: #0552A9;
						/* padding: 0 0 22rpx 0;
	 							border-bottom: 2rpx solid #CECECE; */
					}

					.div {
						display: flex;
						margin: 21rpx auto 0;

						.left {
							font-size: 20rpx;
							font-family: PingFangSC-Regular, PingFang SC;
							font-weight: 400;
							color: #3A3A3A;
						}

						.right {
							font-size: 20rpx;
							font-family: PingFangSC-Regular, PingFang SC;
							font-weight: 400;
							color: #686868;

							text {
								color: #DC0000;
							}

							input {
								font-size: 20rpx;
								font-family: PingFangSC-Regular, PingFang SC;
								font-weight: 400;
								color: #999999;
								width: 400rpx;
								text-indent: 10rpx;
							}

							.placeholder-class {
								color: #999999;
							}
						}

						&:last-child {
							align-items: center;
						}

						.custom-radio-group {
							display: flex;
							font-size: 20rpx;
							font-family: PingFangSC-Regular, PingFang SC;
							font-weight: 400;

							.labelRadio {
								display: flex;
								margin: 0 10rpx;
								align-items: center;
							}

							/deep/.uni-radio-input {
								width: 20rpx;
								height: 20rpx;
								border: 1rpx solid #979797;
							}

							.yes {

								/deep/.uni-radio-input {
									background: #07D276 !important;
									border-color: #07D276 !important;

									&::before {
										background: #07D276;
										border-radius: 50%;
										font-size: 16rpx;
									}
								}
							}

							.no {

								/deep/.uni-radio-input {
									background: #FF1F1F !important;
									border-color: #FF1F1F !important;
									position: relative;
									transform: rotate(45deg);

									&::before {
										content: "";
										position: absolute;
										top: 50%;
										left: 50%;
										background-color: #fff;
										width: 2rpx;
										height: 60%;
										transform: translate(-50%, -50%);
									}

									&::after {
										content: "";
										position: absolute;
										top: 50%;
										left: 50%;
										background-color: #fff;
										width: 60%;
										height: 2rpx;
										transform: translate(-50%, -50%);
									}
								}
							}
						}
					}
				}

				.dd {

					.up {
						display: flex;
						align-items: center;
						justify-content: space-between;
						margin-top: 30rpx;
						margin-bottom: 20rpx;

						.h1 {
							font-size: 22rpx;
							font-family: PingFangSC-Regular, PingFang SC;
							font-weight: 400;
							color: #333333;
							// margin: 10rpx auto;
							text-indent: 26rpx;
							width: 50%;
						}

						.titles-right {

							.list {
								display: flex;
								align-items: center;

								.option {
									padding: 6px 17px;
									border: 1px solid #C3C3C3;
									border-radius: 2px 0 0 2px;
									font-size: 10px;
									font-family: PingFangSC-Regular, PingFang SC;
									font-weight: 400;
									color: #666666;
									background: #fff;

									&+.option {
										border-left: 0;
										border-radius: 0;
									}

									&.active {
										border: 1px solid #e3b339;
										background: #e3b339;
										color: #fff;
									}

									&:last-child {
										border-radius: 0 2px 2px 0;
									}
								}
							}
						}
					}

					.block {
						background: #FFFFFF;
						box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
						border-radius: 15rpx;
						padding: 23rpx 26rpx;

						.li {
							/deep/.uni-select__selector-item {
								font-size: 21rpx;
								font-family: PingFangSC-Regular, PingFang SC;
								font-weight: 400;
								color: #333333;
								padding: 8rpx 10px !important;
								text-align: left !important;
								height: auto !important;
								line-height: initial !important;
							}

							/deep/.uni-select__selector-empty {
								font-size: 21rpx;
								font-family: PingFangSC-Regular, PingFang SC;
								font-weight: 400;
								color: #333333;
							}

							/deep/.uni-select {
								height: auto;
								padding: 5px;
							}

							/deep/.uni-select__input-box {
								height: auto;
							}

							/deep/.uni-select__input-text {
								font-size: 19rpx;
								white-space: normal;
							}

							/deep/.uni-input-wrapper {
								font-size: 21rpx;
							}

							.titles {
								font-size: 20rpx;
								font-family: PingFangSC-Medium, PingFang SC;
								font-weight: 500;
								color: #353535;
								position: relative;
								display: flex;
								flex-direction: row;
								align-items: flex-start;
								justify-content: space-between;


								.titles-left {
									width: 420rpx;
								}

								.titles-right {
									display: flex;
									flex-direction: row;
									align-items: flex-end;
									justify-content: flex-end;
									height: 30rpx;
									margin-top: 20rpx;
								}

								text {
									margin: 0 6rpx 0 0;
								}

								&.red {

									text {
										color: #EF0000;
									}
								}

								.guide {
									color: #026DC6;
									display: flex;
									align-items: center;
									margin-right: 10rpx;

									image {
										width: 22rpx;
										height: 22rpx;
										margin: 0 6rpx 0 0;
									}

									.triangle {
										width: 0;
										height: 0;
										border-top: 8rpx solid transparent;
										border-bottom: 8rpx solid transparent;
										border-left: 10rpx solid #026DC6;
										position: absolute;
										top: 50%;
										right: -20rpx;
										transform: translate(-50%, -50%);
									}
								}
							}

							.optionList {
								display: flex;
								flex-direction: column;
								margin: 10px auto 0;
								align-items: flex-end;

								.list {
									display: flex;

									.option {
										padding: 12rpx 30rpx;
										border: 2rpx solid #C3C3C3;
										border-radius: 5rpx 0 0 5rpx;
										font-size: 18rpx;
										font-family: PingFangSC-Regular, PingFang SC;
										font-weight: 400;
										color: #666666;

										&:nth-child(2) {
											border-left: none;
											// border-right: none;
											border-radius: 0;
										}

										&:last-child {
											border-radius: 0 5rpx 5rpx 0;
											border-left: 0;
										}

										&.active {
											background: #E9F2FF;
											color: #0552A9;
										}
									}
								}

								.case {
									// width: 650rpx;
									width: 100%;

									.h2 {
										font-size: 16rpx;
										font-family: PingFangSC-Medium, PingFang SC;
										font-weight: 500;
										color: #353535;
										margin: 20rpx 0 6rpx 0;
									}

									input {
										margin: 20rpx auto;
										border: 2rpx solid #e5e5e5;
										// border: 2rpx solid red;
										border-radius: 6rpx;
										text-indent: 10rpx;
										font-size: 18rpx;
										padding: 16rpx 0;

										&.inspect {
											border: 2rpx solid #e5e5e5;
										}
									}

									.placeholder-class {
										color: red;
									}

									.placeholder-class-inspect {
										color: yellow;
									}

									.no-realy-content {
										display: flex;
										align-items: flex-end;
										width: 100%;
										flex-direction: column;
										justify-content: space-between;

										/deep/.rudon-select__input-box {
											font-size: 21rpx;
										}

										/deep/.rudon-select__selector-item {
											font-size: 21rpx;
											padding: 0 !important;
										}

										/deep/.uni-icons::before {
											font-size: 21rpx;
										}

										.rudon-component__select {
											border: 2rpx solid #e5e5e5;
											padding: 16rpx;
											width: calc(100% - 32rpx);
											border-radius: 10rpx;
										}
									}
								}
							}

							&+.li {
								margin: 20rpx auto 0;

								.title {

									// text {
									// 	color: #353535;
									// }
								}
							}
						}
					}
				}
			}
		}

	}

	.fixed {
		position: fixed;
		left: 0;
		bottom: 0;
		height: 92rpx;
		background: #fff;
		padding: 0 95rpx 24rpx 95rpx;
		margin: 0 auto;
		display: flex;
		align-items: center;
		width: calc(100% - 190rpx);

		button {
			width: 269rpx;
			height: 55rpx;
			line-height: 55rpx;
			background: #0552A9;
			border-radius: 10rpx;
			font-size: 20rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;

			&.determine {
				color: #fff;
			}

			&.cancellation {
				display: none;
				background: none;
				border: 1rpx solid #979797;
				color: #979797;
			}
		}
	}
}

.facadePhotoPopupContent,
.noticeFormPopupContent,
.taskAssociationContent,
.inspectionGuidelinesContent {
	background: #FFFFFF;
	border-radius: 20rpx 20rpx 0 0;

	.title {
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		background: url('../../static/img/popupTitle.png') no-repeat center center;
		background-size: cover;
		font-size: 25rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		// text-indent: 45rpx;
		text-align: center;
	}

	.box {
		padding: 45rpx 30rpx;

		.image-list {
			display: flex;
			flex-wrap: wrap;
			justify-content: flex-start;

			.image-item {
				position: relative;
				width: 212rpx;
				height: 212rpx;
				overflow: hidden;
				border-radius: 20rpx;
				margin: 0 25rpx 25rpx 0;

				&:nth-child(3n) {
					margin: 0 0 25rpx 0;
				}

				.itemImg {
					width: 100%;
					border-radius: 20rpx;
				}

				.delete {
					position: absolute;
					top: 16rpx;
					right: 16rpx;
					width: 20rpx;
					height: 20rpx;
				}
			}

			.upload {
				width: 212rpx;
				height: 212rpx;
				background: url('../../static/img/upload.png') no-repeat center center;
				background-size: cover;
				padding: 0;
				margin: 0;
			}

		}

		.div {
			display: flex;
			align-items: center;
			justify-content: flex-start;
			min-height: 68rpx;
			line-height: 68rpx;
			font-size: 21rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #333333;
			border-bottom: 2rpx solid #D6D6D6;

			.titles {
				width: 199rpx;
				text-indent: 45rpx;
				border-right: 2rpx solid #D6D6D6;
			}

			.state {
				width: 307rpx;
				text-align: left;
				text-indent: 88rpx;
				border-right: 2rpx solid #D6D6D6;
				display: flex;
				align-items: center;

				.yes {
					color: #333333;
				}

				.no {
					color: #FF2A2A;

					image {
						width: 21rpx;
						height: 21rpx;
						margin: 0 0 0 10rpx;
					}
				}
			}

			.details {
				width: 206rpx;
				height: 100%;
				text-align: center;
				color: #0552A9;
			}

			&:nth-child(even) {
				background: #F9F9F9;
			}
		}

		.dt {
			font-size: 20rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #FF4242;
			text-align: center;
			margin: 26rpx auto 0;
		}

		.dd {
			display: flex;
			align-items: center;
			border-bottom: 2rpx solid #D6D6D6;
			font-size: 21rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #333333;
			border-top: 2rpx solid #D6D6D6;
			border-left: 2rpx solid #D6D6D6;
			border-right: 2rpx solid #D6D6D6;

			/deep/.uni-checkbox-input {
				width: 20rpx;
				height: 20rpx;
				margin: 0 12.5rpx 0 32rpx;
				border-radius: 0;
				border-color: #0552A9;
			}

			/deep/.uni-checkbox-input-checked {
				background: #0552A9;

				&::before {
					color: #fff;
					font-size: 16rpx;
				}
			}

			>view {

				&:nth-child(1) {
					width: 95rpx;
					height: 68rpx;
					line-height: 68rpx;
					text-align: center;
					border-right: 2rpx solid #D6D6D6;
				}

				&:nth-child(2) {
					width: 410rpx;
					height: 68rpx;
					line-height: 68rpx;
					text-align: left;
					border-right: 2rpx solid #D6D6D6;
					text-indent: 2em;
				}

				&:nth-child(3) {}
			}

			&+.dd {
				border-top: none;
			}
		}
	}

	.button {
		margin: 58rpx auto 0;
		padding: 0 95rpx 24rpx 95rpx;
		display: flex;

		button {
			width: 269rpx;
			height: 55rpx;
			line-height: 55rpx;
			background: #0552A9;
			border-radius: 10rpx;
			font-size: 20rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;

			&.determine {
				color: #fff;
			}

			&.cancellation {
				background: none;
				border: 1rpx solid #979797;
				color: #979797;
			}
		}
	}
}

.noticeFormPopupContent {

	.h1Title {
		font-size: 26rpx;
		margin: 20rpx auto 0;
		text-align: center;
	}

	.h2Ttitle {
		font-size: 30rpx;
		text-align: center;
	}

	.box {
		padding: 45rpx 30rpx;
		height: 400px;
		overflow-x: hidden;

		.div {
			border-top: 2rpx solid #D6D6D6;
			border-left: 2rpx solid #D6D6D6;
			border-right: 2rpx solid #D6D6D6;
			line-height: initial;
			height: initial;
			min-height: 82rpx;
			position: relative;

			&::before {
				content: "";
				display: block;
				width: 2rpx;
				height: 100%;
				background: #D6D6D6;
				position: absolute;
				top: 50%;
				left: 229rpx;
				transform: translate(-50%, -50%);
			}

			.titles {
				width: 229rpx;
				line-height: 1.2;
				height: 100%;
				display: flex;
				flex-direction: column;
				justify-content: center;
				margin: 0 20rpx 0 0;
				border-right: 0;
			}

			.textarea {
				width: 50%;
				padding: 10rpx 0;
			}

			input {
				font-size: 21rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				width: 460rpx;
				text-indent: 20rpx;
			}

			.value {
				font-size: 21rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				width: 460rpx;
				text-indent: 20rpx;
			}

			.placeholder-class {
				color: #999999;
			}

			.uni-stat__select {
				width: 460rpx;

				/deep/.uni-select {
					border: none;
				}
			}

			.uni-date {
				width: 460rpx;

				/deep/.uni-date-editor--x {
					border: none;
				}
			}

			&+.div {
				border-top: none;
			}
		}
	}
}

.riskReminderDetailsContent {

	.illustrate {

		.titles {
			font-size: 20rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #333333;
		}

		.content {
			font-size: 20rpx;
			color: #666666;
			padding: 10px 0px;
		}
	}

	.button {
		margin: 58rpx auto 0;
		padding: 0 95rpx 24rpx 95rpx;
		display: flex;

		button {
			width: 269rpx;
			height: 55rpx;
			line-height: 55rpx;
			background: #0552A9;
			border-radius: 10rpx;
			font-size: 20rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;

			&.determine {
				color: #fff;
			}

			&.cancellation {
				background: none;
				border: 1rpx solid #979797;
				color: #979797;
			}
		}
	}

	.closeReturn {
		width: 80%;
		margin: 30rpx auto 0;
		height: 55rpx;
		line-height: 55rpx;
		background: #0552A9;
		border-radius: 10rpx;
		font-size: 20rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #fff;
		text-align: center;
		position: relative;
		top: -30rpx;
	}
}


.inspectionGuidelinesContent {

	.box {

		.div {

			border-top: 2rpx solid #D6D6D6;
			border-left: 2rpx solid #D6D6D6;
			border-right: 2rpx solid #D6D6D6;

			&+.div {
				border-top: none;
			}

			.contents {
				text-indent: 20rpx;
			}
		}

		.closeReturn {
			width: 80%;
			margin: 30rpx auto 0;
			height: 55rpx;
			line-height: 55rpx;
			background: #0552A9;
			border-radius: 10rpx;
			font-size: 20rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #fff;
			text-align: center;
		}
	}
}


.popupContent,
.popupContentTwo {
	background: #FFFFFF;
	border-radius: 20rpx 20rpx 0 0;

	.title {
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		background: url('../../static/img/popupTitle.png') no-repeat center center;
		background-size: cover;
		font-size: 25rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		// text-indent: 45rpx;
		text-align: center;
	}

	.box {
		text-align: center;
		margin: 50rpx auto;
	}

	.button {
		margin: 58rpx auto 0;
		display: flex;
		justify-content: space-around;
		align-items: center;

		button {
			width: 269rpx;
			height: 55rpx;
			line-height: 55rpx;
			background: #0552A9;
			border-radius: 10rpx;
			font-size: 20rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;

			&.determine {
				color: #fff;
			}

			&.cancellation {
				background: none;
				border: 1rpx solid #979797;
				color: #979797;
			}
		}
	}
}

.sig-image {
	width: 100px;
	height: 50px;
	margin-left: 20px;
}

.item-text {
	line-height: 30px;
}

.box-item {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: flex-start;
	padding: 0px 14px;

}

.box-item-left {
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	align-items: flex-start;
}

.btna {
	font-size: 16px;
	color: #0055ff;

}

.location-status {
	font-size: 16px;
	color: #07D276;
	text-align: center;
}

.location-active {
	font-size: 16px;
	color: #d22741;
	text-align: center;
}

.no-realy-content {
	// display: flex;
	// flex-direction: row;
	// justify-content: space-between;
	// align-items: center;
	// // width: 650rpx;
	// width: 100%;
	display: flex;
	align-items: flex-end;
	width: 100%;
	flex-direction: column;
	justify-content: space-between;

	/deep/.rudon-select__input-box {
		font-size: 21rpx;
	}

	/deep/.rudon-select__selector-item {
		font-size: 21rpx;
		padding: 0 !important;
	}

	/deep/.uni-icons::before {
		font-size: 21rpx;
	}
}

.uni-select__input-text {
	font-size: 19rpx;
}

.content-upload-btn {
	margin-left: 20px;
	border: 0px;
	border-radius: 7px;
	background-color: #e3b339;
	color: #ffffff;
	padding: 6px 15px;
	font-size: 20rpx;
}

.content-upload-btn-realy {
	background-color: #1da247;
	margin-left: 20px;
	border: 0px;
	border-radius: 7px;
	color: #ffffff;
	padding: 6px 15px;
	font-size: 20rpx;
}

.upload-btn {
	padding: 5px 15px;
	border-radius: 7px;
	background-color: #026DC6;
	font-size: 13px;
	color: #ffffff;
}

.inform-image {
	width: 100px;
	height: 100px;
	margin-left: 10px;
	margin-right: 10px;
}

.manage_status_box {
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	align-items: center;
	background: #FFFFFF;
	box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
	border-radius: 15rpx;
	padding: 23rpx 28rpx;
	margin-bottom: 20rpx;

}

// .custom-radio-group {
// 	display: flex;

// 	.labelRadio {
// 		display: flex;
// 		margin: 0 10rpx;
// 		align-items: center;
// 	}

// 	/deep/.uni-radio-input {
// 		width: 20rpx;
// 		height: 20rpx;
// 		border: 1rpx solid #979797;
// 	}

// 	.yes {

// 		/deep/.uni-radio-input {
// 			background: #07D276 !important;
// 			border-color: #07D276 !important;

// 			&::before {
// 				background: #07D276;
// 				border-radius: 50%;
// 				font-size: 16rpx;
// 			}
// 		}
// 	}

// 	.no {

// 		/deep/.uni-radio-input {
// 			background: #FF1F1F !important;
// 			border-color: #FF1F1F !important;
// 			position: relative;
// 			transform: rotate(45deg);

// 			&::before {
// 				content: "";
// 				position: absolute;
// 				top: 50%;
// 				left: 50%;
// 				background-color: #fff;
// 				width: 2rpx;
// 				height: 60%;
// 				transform: translate(-50%, -50%);
// 			}

// 			&::after {
// 				content: "";
// 				position: absolute;
// 				top: 50%;
// 				left: 50%;
// 				background-color: #fff;
// 				width: 60%;
// 				height: 2rpx;
// 				transform: translate(-50%, -50%);
// 			}
// 		}
// 	}
// }

.manage_status_title {
	font-size: 26rpx;
}

.custom-radio-group {
	display: flex;
	font-size: 26rpx;
	font-family: PingFangSC-Regular, PingFang SC;
	font-weight: 400;

	.labelRadio {
		display: flex;
		margin: 0 10rpx;
		align-items: center;

		/deep/radio {
			display: none;
		}

		&::before {
			content: '';
			width: 20rpx;
			height: 20rpx;
			line-height: 20rpx !important;
			text-align: center;
			border: 1rpx solid #979797;
			border-radius: 50%;
			font: normal normal normal 14px / 1 uni;
			font-size: 20rpx;
			color: #fff;
			margin: 0 4rpx 0 0;
		}

		&.yes::before {
			content: "\EA08";
			background-color: #07D276;
			border-color: #07D276;
		}

		&.no::before {
			content: "\00D7";
			background-color: #FF1F1F;
			border-color: #FF1F1F;
			line-height: 18rpx !important;
		}
	}
}

.abnormal {
	background: #FFFFFF;
	box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
	border-radius: 15rpx;
	padding: 23rpx 28rpx;
	margin-bottom: 20rpx;


	.block {
		.text {
			display: flex;
			flex-direction: row;
			justify-items: flex-start;
			align-items: center;
			padding: 23rpx 0rpx;

			.topicFlex {
				display: flex;
				justify-content: flex-start;
				width: 26%;
				font-size: 24rpx;
			}

			.uni-stat__select {
				width: 460rpx;

				/deep/.uni-select {
					// border: none;
					// padding: 0;
				}

				/deep/.uni-select__input-placeholder {
					font-size: 19rpx;
				}

				/deep/.uni-select__selector {
					// padding: 0;
				}

				/deep/.uni-select__selector-item {
					font-size: 19rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #333333;
					padding: 5px 10px !important;
					text-align: left !important;
					line-height: 1.6 !important;
				}

				/deep/.uni-select__selector-empty {
					font-size: 19rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #333333;
				}
			}

			.div {
				display: flex;
				flex-direction: column;
				line-height: initial;
			}

			text {
				font-size: 24rpx;
			}
		}
	}
}

.three {
	background: #FFFFFF;
	box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
	border-radius: 15rpx;
	padding: 23rpx 28rpx;
	margin-bottom: 20rpx;

	.box {

		.text {
			display: flex;
			flex-direction: row;
			align-items: flex-start;
			justify-content: flex-start;

			view {
				color: #1e4de6
			}
		}

		.facadePhoto {
			height: 150px;
			font-size: 26rpx;

			image {
				width: 100rpx;
				height: 100rpx;
			}
		}
	}
}

.uni-select__input-text {
	font-size: 19rpx;
}

.text-red {
	color: #e11515;
}

.float-border {
	// border:1px solid red;
	padding: 20rpx;
	// overflow: hidden;
	box-shadow: 0px 0px 15rpx 6rpx rgba(147, 142, 213, 0.5);
	transition: box-shadow 0.3s ease;
	border-radius: 10rpx;
}

.socialResponsibility {

	.li {
		.h1 {
			font-size: 22rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #333333;
			margin: 10rpx auto;
			text-indent: 26rpx;
		}

		.box {
			background: #FFFFFF;
			box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
			border-radius: 15rpx;
			padding: 23rpx 26rpx;

			/deep/.uni-select__selector-item {
				font-size: 21rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #333333;
				padding: 8rpx 10px !important;
				text-align: left !important;
				height: auto !important;
				line-height: initial !important;
			}

			/deep/.uni-select__selector-empty {
				font-size: 21rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #333333;
			}

			/deep/.uni-select__input-text {
				font-size: 21rpx;
			}

			/deep/.uni-input-wrapper {
				font-size: 21rpx;
			}

			.titles {
				font-size: 22rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #353535;
				position: relative;
				display: flex;
				flex-direction: row;
				align-items: flex-start;
				justify-content: space-between;


				.titles-left {
					width: 420rpx;
				}

				text {
					margin: 0 6rpx 0 0;
				}

				&.red {

					text {
						color: #EF0000;
					}
				}

				.titles-right {
					display: flex;
					flex-direction: row;
					align-items: flex-end;
					justify-content: flex-end;
					height: 30rpx;
					margin-top: 20rpx;
				}

				.guide {
					color: #026DC6;
					display: flex;
					align-items: center;
					margin-right: 10rpx;

					image {
						width: 22rpx;
						height: 22rpx;
						margin: 0 6rpx 0 0;
					}

					.triangle {
						width: 0;
						height: 0;
						border-top: 8rpx solid transparent;
						border-bottom: 8rpx solid transparent;
						border-left: 10rpx solid #026DC6;
						top: 50%;
						right: -20rpx;
						transform: translate(-50%, -50%);
					}
				}
			}

			.optionList {
				display: flex;
				flex-direction: column;
				margin: 10px auto 0;
				align-items: flex-end;

				.list {
					display: flex;

					.option {
						padding: 12rpx 30rpx;
						border: 2rpx solid #C3C3C3;
						border-radius: 5rpx 0 0 5rpx;
						font-size: 18rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #666666;

						&:nth-child(2) {
							border-left: none;
							// border-right: none;
							border-radius: 0;
						}

						&:last-child {
							border-radius: 0 5rpx 5rpx 0;
							border-left: 0;
						}

						&.active {
							background: #E9F2FF;
							color: #0552A9;
						}
					}
				}

				.case {
					// width: 650rpx;
					width: 100%;

					.h2 {
						font-size: 16rpx;
						font-family: PingFangSC-Medium, PingFang SC;
						font-weight: 500;
						color: #353535;
						margin: 20rpx 0 6rpx 0;
					}

					input {
						margin: 20rpx auto;
						border: 2rpx solid #e5e5e5;
						// border: 2rpx solid red;
						border-radius: 6rpx;
						text-indent: 10rpx;
						font-size: 18rpx;
						padding: 16rpx 0;

						&.inspect {
							// border: 2rpx solid yellow;
							border: 2px solid #e5e5e5;
						}
					}

					.placeholder-class {
						color: red;
					}

					.placeholder-class-inspect {
						// color: yellow;
						color: #e5e5e5;
					}
				}
			}

			&+.li {
				margin: 20rpx auto 0;

				.title {

					// text {
					// 	color: #353535;
					// }
				}
			}
		}
	}
}

/deep/.uni-select__input-text {
	font-size: 19rpx !important;
}

.problem {
	width: 100%;
	border: 1px solid #D6D6D6;
	margin-top: 10px;
}

.global-options {
	display: flex;
	align-items: center;

	.option {
		margin-left: 10rpx;
		padding: 6px 17px;
		border: 1px solid #C3C3C3;
		border-radius: 2px;
		font-size: 10px;
		color: #666;
		background: #fff;
		text-indent: 0;

		&.active {
			border: 1px solid #e3b339;
			background: #e3b339;
			color: #fff;
		}
	}
}
</style>